package edu.hncj.seckill.service.impl;

import edu.hncj.seckill.dao.BusinessMapper;
import edu.hncj.seckill.domain.Business;
import edu.hncj.seckill.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author gcl
 */
@Service
public class BusinessServiceImpl implements BusinessService {

    @Autowired
    BusinessMapper businessMapper;

    @Override
    public Business seletByLoginName(String loginName) {
        return businessMapper.selectByLoginName(loginName);
    }

    @Override
    public Business seletByBusinessName(String businessName) {
        return businessMapper.selectByBusinessName(businessName);
    }

    @Override
    public Business seletByPhoneNumber(String phoneNumber) {
        return businessMapper.seletByPhoneNumber(phoneNumber);
    }

    @Override
    public int insertBusiness(Business business) {
        return businessMapper.insert(business);
    }

    @Override
    public int insertBusinessRole(String userId, String businessid) {
        return businessMapper.insertBusinessRole(userId, businessid);
    }

    @Override
    public Business seletByID(String bid) {
        return businessMapper.selectByPrimaryKey(Long.parseLong(bid));
    }

}
